import request from '@/utils/request'

// 获取时段下拉列表
export function getTimeFrameList() {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/timeFrameList',
    method: 'get'
  })
}

// 获取经验下拉列表
export function getExperienceList() {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/expList',
    method: 'get'
  })
}

// 查询班组管理列表
export function getTeamList(params) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/list',
    method: 'get',
    params
  })
}

// 获取班组管理详细信息
export function getTeamDetail(teamsAndGroupsId) {
  return request({
    url: `/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/${teamsAndGroupsId}`,
    method: 'get'
  })
}

// 新增班组管理
export function addTeam(data) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin',
    method: 'post',
    data
  })
}

// 修改班组管理
export function updateTeam(data) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin',
    method: 'put',
    data
  })
}

// 删除班组管理
export function deleteTeam(teamsAndGroupsIds) {
  return request({
    url: `/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/${teamsAndGroupsIds}`,
    method: 'delete'
  })
}

// 获取成员列表
export function getMemberList() {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/memberList',
    method: 'get'
  })
}

// 添加成员
export function addMember(params) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/addMember',
    method: 'get',
    params
  })
}

// 导出班组管理列表
export function exportTeam(params) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/export',
    method: 'post',
    params,
    responseType: 'blob'
  })
}


// 删除成员
export function deleteMember(params) {
  return request({
    url: '/dispatch/dispatch/dispatchTeamsAndGroupsAdmin/delMember',
    method: 'get',
    params
  })
}